# Maintainer: Mazhar Hussain <realmazharhussain@gmail.com>

_realname=blueprint-compiler
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=0.16.0
pkgrel=1
pkgdesc='A markup language for GTK user interfaces (mingw-w64)' 
url='https://jwestman.pages.gitlab.gnome.org/blueprint-compiler/'
msys2_repository_url='https://gitlab.gnome.org/jwestman/blueprint-compiler'
license=('spdx:LGPL-3.0-or-later')
arch=(any)
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
depends=(${MINGW_PACKAGE_PREFIX}-python-gobject)
makedepends=(${MINGW_PACKAGE_PREFIX}-meson)
source=(https://gitlab.gnome.org/jwestman/blueprint-compiler/-/archive/v$pkgver/blueprint-compiler-v$pkgver.tar.gz)
sha256sums=('01feb8263fe7a450b0a9fed0fd54cf88947aaf00f86cc7da345f8b39a0e7bd30')

build() {
  MSYS2_ARG_CONV_EXCL="--prefix=" \
  "${MINGW_PREFIX}"/bin/meson setup \
    --prefix="${MINGW_PREFIX}" \
    $_realname-v$pkgver \
    build-${MSYSTEM}

  meson compile -C build-${MSYSTEM}
}

check() {
  meson test -C build-${MSYSTEM}
}

package() {
  meson install -C build-${MSYSTEM} --destdir="$pkgdir"
  install -Dm644 $_realname-v$pkgver/COPYING "$pkgdir/$MINGW_PREFIX"/share/licenses/$_realname/COPYING
}
